-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Date Picker] fix: moment date conversion for Date Picker in native #15033
Conversation
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@Beamanator @Santhosh-Sellavel One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@@ -65,6 +65,7 @@ const CONST = { | |||
MOMENT_FORMAT_STRING: 'YYYY-MM-DD', | |||
UNIX_EPOCH: '1970-01-01 00:00:00.000', | |||
MAX_DATE: '9999-12-31', | |||
MIN_DATE: '0001-01-01', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set this like this because in web, this is the earliest date by default.
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
gentle bump @Santhosh-Sellavel |
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
@Santhosh-Sellavel pushed! |
@Prince-Mendiratta will you please update the PR title to be more useful? It's best if it describes exactly what you're doing in this PR |
Android calendar is not persisted for previously selected months if before 1900. Check month is shown as January 1900 Screen_Recording_20230214_035805_New.Expensify.mp4 |
Reviewer Checklist
Screenshots/VideosWeb & DesktopScreen.Recording.2023-02-14.at.4.06.56.AM.movMobile Web - ChromeScreen_Recording_20230214_035903_Chrome.mp4Mobile Web - SafariSimulator.Screen.Recording.-.iPhone.14.-.2023-02-14.at.04.05.25.mp4iOSSimulator.Screen.Recording.-.iPhone.14.-.2023-02-14.at.04.04.49.mp4AndroidScreen_Recording_20230214_035805_New.Expensify.mp4 |
Will continue tomorrow |
Any thoughts on this #15033 (comment)? CC: @Beamanator |
Interesting find - I think this is fine for now, since we're actually building our own cross-platform Date Picker at the moment, so this shouldn't be a problem in the near future 👍 |
@Santhosh-Sellavel I'm not too sure about that behaviour either, wasn't able to find any relevant resource online ;-; |
bump @Santhosh-Sellavel, I think this should be good to merge? |
@Beamanator
Values should not be persisted right? |
Okay checked other forms seems this is common to all forms not specific to this one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM tests well!
All you @Beamanator
@Santhosh-Sellavel Thanks for bringing this up, I noticed the weirdness too while I was testing too. Didn't report since the new Date Picker design will fix them anyways. It was important for this PR to at least remove the functionality issue and keep things running while the new date picker is in the works. Can revisit this after the new design is done. |
If you’ve noticed earlier it's always to good bring forward for discussion. This helps speeds things! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 👍
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/Beamanator in version: 1.2.75-0 🚀
|
🚀 Deployed to production by https://github.com/melvin-bot[bot] in version: 1.2.75-0 🚀
|
Details
The main problem that we are trying to solve in this issue is that for the date picker in Date of Birth under the Personal Details component, the selected date is not acknowledged and shows the error Date Invalid even when the date is valid in native devices on iOS and android. Moreover, the possible dates shown to the user are not consistent across platforms.
Fixed Issues
$ #14936
PROPOSAL: #14936 (comment)
Tests
Please enter a valid date
.Date should be before 20xx-xx-xx.
Offline tests
N/A
QA Steps
Please enter a valid date
.Date should be before 20xx-xx-xx.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.Screenshots/Videos
Web - Chrome
web-chrome.mp4
Web - Safari
web-safari.mp4
Mobile Web - Chrome
mWeb-Chrome.mp4
Mobile Web - Safari
mWeb-safari.mp4
Desktop
desktop.mp4
iOS
iOS.mp4
Android
android.mp4